#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
#include <unistd.h>
#include <fcntl.h>
#include "errsys.h"

int main(int argc, char **argv)
{
	mode_t mode=076644;
	if(S_ISREG(mode))
		printf("is reg\n");
	if(S_ISDIR(mode))
		printf("is dir\n");
	if(S_ISCHR(mode))
		printf("is chr\n");
	if(S_ISBLK(mode))
		printf("is blk\n");
	if(S_ISFIFO(mode))
		printf("is fifo\n");
	if(S_ISLNK(mode))
		printf("is lnk\n");
	if(S_ISSOCK(mode))
		printf("is sock\n");

	printf("u+rwx: %03o\n",S_IRWXU);
	printf("u+r:   %03o\n",S_IRUSR);
	printf("u+w:   %03o\n",S_IWUSR);
	printf("u+x:   %03o\n\n",S_IXUSR);

	printf("g+rwx: %03o\n",S_IRWXG);
	printf("g+r:   %03o\n",S_IRGRP);
	printf("g+w:   %03o\n",S_IWGRP);
	printf("g+x:   %03o\n\n",S_IXGRP);

	printf("o+rwx: %03o\n",S_IRWXO);
	printf("o+r:   %03o\n",S_IROTH);
	printf("o+w:   %03o\n",S_IWOTH);
	printf("o+x:   %03o\n",S_IXOTH);
	return 0;
}

